﻿<%@ Page Language="C#" MasterPageFile="~/Manage/MainPage.master"   AutoEventWireup="true" CodeFile="PurviewGroupManage.aspx.cs" Inherits="Manage_PurviewGroupManage" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
<script type="text/javascript" src="/Manage/Js/PurviewGroupManage.js"></script>
<script type="text/javascript">
  ModelOfGroup =<%=new PurviewGroups().ToJsonString() %>;
</script>

<table width="99%" border="0" cellpadding="0" cellspacing="0" class="table">
      <tr>
        <td width="50"  align="center"  class="TableHeadRow">编号</td>
        <td  align="left"  class="TableHeadRow">分组名称</td>
        <td width="7%" align="center"  class="TableHeadRow">排序值</td>
        <td width="8%" align="center"  class="TableHeadRow">状态</td>
        <td width="14%" align="center"  class="TableHeadRow">创建时间</td>
        <td width="18%" align="center"  class="TableHeadRow">操作 [<a href="javascript:void(0);" onclick="javascript:Add();" class="red">添加分组</a>] </td>
      </tr>

      <%
          if (listOfGroups != null)
          {
              for (int i = 0; i < listOfGroups.Count; ++i)
              {
                  PurviewGroups g = listOfGroups[i];
         %>
     <tr  onmouseover="this.style.backgroundColor='#F2F2F2';" onmouseout="this.style.backgroundColor='#FFFFFF';">
       <td align="center" ><%=i+1 %>.</td>
        <td align="left"  ><a href="javascript:void(0);" onclick="Edit(<%=g.PurviewGroupID %>);" class="blue"><%=g.GroupName %></a> (ID=<%=g.PurviewGroupID %>) </td>
        <td align="center"  ><%=g.OrderValue %></td>
        <td align="center"  >
        
        <%
            string className = "";
            if (g.Status == Status.正用.ToString())
                className = "green";
            else
                className = "red";
                  %>
                  
                <span class="<%=className %>"><%=g.Status %></span>
                  </td>
        <td align="center"  ><%=g.CreateDate.ToString("yyyy-MM-dd HH:mm:ss")%></td>
        <td align="center"  >[<a href="javascript:void(0);" onclick="Edit(<%=g.PurviewGroupID %>);" class="blue">编辑</a>]   &nbsp;&nbsp;   [<a href="javascript:void(0);" onclick="Delete(<%=g.PurviewGroupID %>);" class="red">删除</a>] </td>
      </tr>
      <%}
          }
          else
          { %>
      <tr>
        <td colspan="6" align="center"  class="red">[ 未找到任何分组信息! ]</td>
      </tr>
      <%} %>
    </table>

</asp:Content>